package com.example.final_project.Comm.Activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.final_project.MainView;
import com.example.final_project.R;

public class CarActivity extends AppCompatActivity {

    private ImageView back;
    private TextView name,content;
    private Context context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_car);

        Intent intent = this.getIntent();
        String cname = intent.getStringExtra("name");
        findById();

        name.setText("欢迎来到"+cname);
        content.setText("暂无用户发布信息");

        //返回点击事件
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent1 = new Intent(CarActivity.this, MainView.class);
                intent1.setAction("backToComm");
                startActivity(intent1);
            }
        });

    }

    public void findById(){
        back = this.findViewById(R.id.Gcar_back);
        name = this.findViewById(R.id.Gcar_name);
        content = this.findViewById(R.id.Gcar_content);
        context = getBaseContext();
    }

}